<template>
  <div class="home">
	<nav-bar>
		<template v-slot:default>首页</template>
	</nav-bar>
	<div class="banner">
		<img src="@/assets/images/banner.png" />
	</div>
	
	<recommend-view recommends="recommends">
		
	</recommend-view>
	
  </div>
</template>

<script>
import {ref,reactive,onMounted} from 'vue';
import {maplist,anilist,recommend} from '@/api/home';
import NavBar from '@/components/common/navbar/NavBar.vue';
import RecommendView from '@/components/content/RecommendView.vue';
export default {
  name: 'Home',
  components:{
	  NavBar,
	  RecommendView
  },
  
  setup(){
	  const recommends=ref([])
	  const a=ref([])
	  onMounted(()=>{
		  /* maplist().then(res=>{
			  console.log(res)
		  })
		  anilist().then(res=>{
			  console.log(res)
		  }) */
		  recommend().then(res=>{
			  res=JSON.parse(res.data)
			  recommends.value=res.data.list
		  })
		  
		  
	  })
	  return{
		recommends
	  }
  }
}
</script>

<style lang="scss" scoped>
	
	.banner{
		margin-top: 46px;
	}
</style>
